<?php

namespace modules\home\controller;


use core\controller\Controller;
use core\library\Input;
use modules\home\model\UserModel;
use proxy\LoginAspect;

class IndexController extends Controller {
    /**
     * @Autowire
     * @var Input $input
     */
    private $input;


    /**
//     * @param UserModel $userModel
     * @return mixed
     * @throws \Exception
     */
    public function actionIndex(LoginAspect $loginAspect) {
        echo "before init<br />";
        $loginAspect->printHello();
        echo "<br />after init";
//        $res = $userModel->findByPk(1);
//        return $res;
//        var_dump($this->input);
//        var_dump($model);
//        var_dump($input);
//        var_dump($a);
//        $data = $this->renderJson();
//        $this->render();
//        $this->success('http://www.baidu.com', '成功测试');
    }


    public function actionPostTest() {
        return $this->input->post();
    }
    public function actionTestForward() {
//        $this->input->cookie('hello', 'world');
        echo $this->forward('/?c=1&b[]=2');
    }

    public function actionTestConfig() {
        return config();
    }
}